package com.cps.match.xmlparser;

import org.apache.commons.lang3.StringUtils;

import com.thoughtworks.xstream.mapper.Mapper;
import com.thoughtworks.xstream.mapper.MapperWrapper;

public class UpperCaseMapper extends MapperWrapper {
	public UpperCaseMapper(Mapper wrapped) {
		super(wrapped);
	}

	@SuppressWarnings("rawtypes")
	@Override
	public String serializedMember(Class type, String memberName) {
		return StringUtils.capitalize(memberName);
	}

	@SuppressWarnings("rawtypes")
	@Override
	public String realMember(Class type, String serialized) {
		String camelCase =StringUtils.uncapitalize(serialized);
		return super.realMember(type, camelCase);
	}
}
